<?php
// +----------------------------------------------------------------------
// | sfadmin - Suifeng Administration
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2020 http://suifeng.tech All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: suifeng <1787585212@qq.com>
// +----------------------------------------------------------------------

namespace suifeng\builder\table\column;

use suifeng\builder\table\Column;

class Actions extends Column
{
    /**
     * 标题。
     *
     * @var unknown
     */
    public $title = '操作';

    /**
     * 获取单元格内容。
     *
     * @param unknown $row
     * @return unknown|string
     */
    protected function _fetch_cell_content($row)
    {
        $actions = array();
        foreach ($this->table->actions as $action) {
            $html = $action->render_html($row);
            if ($html) {
                $actions[] = $html;
            }
        }
        return implode('&nbsp;', $actions);
    }
}
